package net.zoneland.zrdp.biz.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.zoneland.zrdp.common.annotation.Anonymous;
import net.zoneland.zrdp.common.core.controller.BaseController;
import net.zoneland.zrdp.common.core.domain.AjaxResult;
import net.zoneland.zrdp.framework.web.domain.bean.DeptParam;
import net.zoneland.zrdp.framework.web.domain.bean.UserParam;
import net.zoneland.zrdp.framework.web.service.PeopleSelectService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api("人员选择框")
@RestController
@RequestMapping("/people/select")
@Anonymous
public class PeopleSelectController extends BaseController {

    @Resource
    private PeopleSelectService peopleSelectService;

    @GetMapping("/queryDepartments")
    @ApiOperation("查询部门信息")
    public AjaxResult queryDepartments(@Validated final DeptParam deptParam) {
        return success(peopleSelectService.queryDepartments(deptParam));
    }

    @GetMapping("/queryUsers")
    @ApiOperation("查询人员信息")
    public AjaxResult queryUsers(final UserParam userParam) {
        return success(peopleSelectService.queryUsers(userParam));
    }

}
